//
//  HeadClass.m
//  YaoHeAPP
//
//  Created by mac on 16/1/11.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "HeadClass.h"

@implementation HeadClass

-(id)initWithDic:(NSDictionary *)dic
{
    self=[super init];
    if (self) {
        self.isShow=[self withDic:dic Key:@"ACTIVITY_IS_SHOW_ENDDATE"];
        self.title=[self withDic:dic Key:@"ACTIVITY_TITLE"];
        self.Img=[self withDic:dic Key:@"ACTIVITY_IMG"];
        self.link=[self withDic:dic Key:@"ACTIVITY_LINK"];
        self.endDate=[self withDic:dic Key:@"ACTIVITY_ENDDATE"];
    }
    return self;
}

-(NSString*)withDic:(NSDictionary*)dic Key:(NSString*)key
{
    NSString*string;
    if ([[dic allKeys]containsObject:key]) {
        string=dic[key];
    }
    else{
       string=@"";
    }
    return string;
}




@end
